@layout("/common/_testCommon.html"){
<title>输入考试密码</title>
</head>
<style>
    body {
        overflow-x: hidden;
        overflow-y: hidden;
    }

    html {
        overflow-x: hidden;
        overflow-y: hidden;
    }
</style>
<body>
<div class="form-horizontal">
    <input type="hidden" id="id" value="">
</div>
<div class="form-group">
    请输入考试名称*：<input type="text" name="theTestName" id="theTestName" class="form-control">
    请输入考试密码*：<input type="text" name="passWord" id="passWord" class="form-control">
</div>
<div class="form-group">
    考试时长*：
    <select id="timeLength" name="timeLength" data-bv-field="timeLength">
        <option value="1">0.1</option>
        <option value="30">0.5</option>
        <option value="60">1</option>
        <option value="90">1.5</option>
        <option value="120">2</option>
        <option value="150">2.5</option>
        <option value="180">3</option>
    </select>
    小时
</div>
<!--<#button btnCss="info" name="添加题型" id="addChoose" icon="fa-check"  />-->
<script language="javascript">
    $('#addChoose').click(function () {
        var parentDiv = document.getElementById('parentDiv');
        var childDiv = document.createElement("div");
        var i = parentDiv.children.length;
        if ($('#scoresOfQuestion').val() == "" || $('#scoresOfQuestion').val() == null) {
            alert("题目数量不能为空！");
            return;
        }
        if ($('#numberOfQuestion').val() == "" || $('#numberOfQuestion').val() == null) {
            alert("每题分数不能为空！");
            return;
        }
        if (i > 0) {
            alert("不能超过已有题型！");
            return;
        }
        childDiv.id = "div" + i;
        childDiv.innerHTML = "" +
            "<table class='tableFrame' width='100%'>" +
            "<tr>" +
            "<td>考题类型*：<select id=\"typeOfQuestion1\">\n" +
            "                <option value=\"1\">单选</option>\n" +
            "                <option value=\"2\">多选</option>\n" +
            "            </select>" +
            "</td>" +
            "</tr>" +
            "<tr>" +
            "<td>请输入考试题量：<input type=\"text\" id=\"numberOfQuestion1\"></td>" +
            "</tr>" +
            "<tr>" +
            "<td>请输入每题分数：<input type=\"text\" id=\"scoresOfQuestion1\"></td>" +
            "<tr>" +
            "<td><input id='btnDel' type='button' value='删除' onclick='DeleteDiv(" + i + ")'/></td>" +
            "</tr>" +
            "</table>";
        parentDiv.appendChild(childDiv);
    })

    //删除div
    function DeleteDiv(str) {
        var parentDiv = document.getElementById('parentDiv');
        var temp = parentDiv.children[str];
        parentDiv.removeChild(temp);
        for (var i = 0; i < parentDiv.children.length; i++) {
            parentDiv.childNodes[i].value = i;
            parentDiv.childNodes[i].childNodes[1].outerHTML = "<input id='btnDel' type='button' value='删除' onclick='DeleteDiv(" + i + ")' />";
        }
    }
</script>
<div>
    <ul>
        <li> 考题类型*：
            <select id="typeOfQuestion" name="typeOfQuestion">
                <option value="1">选择题</option>
                <!--<option value="2">多选</option>-->
            </select>
        </li>
        <li>
            请输入考试题量*：<input type="text" id="numberOfQuestion">
        </li>
        <li>
            请输入每题分数*：<input type="text" id="scoresOfQuestion">
        </li>
        <li>
            通过分数*：<input type="text" id="scoresOfAdoption">
        </li>
    </ul>
</div>
<div id="parentDiv">
</div>
<div class="form-group">
    请输入备注：<input type="textarea" name="remark" id="remark" class="form-control">
</div>
<div class="marginleft">
    <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TheTestInfoDlg.addSubmit()"/>
    <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TheTestInfoDlg.close()"/>
</div>
<script src="${ctxPath}/static/modular/theTest/theTest/theTest_info.js"></script>
@}
